package com.haust.dianqi.service.impl;

import com.haust.dianqi.mapper.UserMapper;
import com.haust.dianqi.pojo.User;
import com.haust.dianqi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Auther: csp1999
 * @Date: 2020/04/27/9:36
 * @Description:
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)//支持事务
    public User login(User user) {

        User findUser = userMapper.login(user);
        return findUser;
    }
}
